// src/
// public/
const path = require('path')
const Timestamp = new Date().getTime()
module.exports = {
    outputDir: process.env.outputDir,
	lintOnSave: false,
    publicPath: './',
    assetsDir: process.env.NODE_ENV !== 'development' ? './static/' : './',
	productionSourceMap:false,
	css: {
        loaderOptions: {
            postcss: {
                plugins: [
                    require('postcss-pxtorem')({
                        rootValue: 37.5,
                        // 哪些属性需要转化px为rem min-width不要设置
                        propList: ['font-size', 'line-height', 'letter-spacing', 'width', 'height', 'margin', 'padding', 'margin-top', 'margin-left', 'magrin-right', 'margin-bottom', 'padding-top', 'padding-left', 'padding-bottom', 'padding-right', 'top', 'right', 'left', 'bottom','border-radius'],
                        // 小于该值 则不做转化
                        minPixelValue: 12,
                    })
                ]
            }
        }
    },
	devServer: {
	    open: false,
	    host: '0.0.0.0',
	    port: 8082,
	    https: false,
	    hotOnly: false,
	     proxy: {
	        '/api': {
	            target: 'http://api.xjyfb.com/api',
	            ws: true,
	            changeOrigin: true,
	            pathRewrite: {
	                '^/api': ''
	            }
	        },
	    },
	    before: app => {}
	},
    pluginOptions: {
        'style-resources-loader': {
            preProcessor: 'less',
            patterns: [
                path.resolve(__dirname, 'src/assets/css/global.less')
            ]
        }
    },
    configureWebpack: {
        output: { // 输出重构  打包编译后的 文件名称  【模块名称.版本号.时间戳】
            filename: `js/[name].${process.env.VUE_APP_Version}.${Timestamp}.js`,
            chunkFilename: `js/[name].${process.env.VUE_APP_Version}.${Timestamp}.js`
        }
    }
}